class Dynamic {
  List<DynamicInfo>? rows;

  Dynamic({this.rows});

  factory Dynamic.fromJson(Map<String, dynamic> json) {
    final originList = json['rows'] as List?;
    List<DynamicInfo> protocolList =
        (originList??[]).map((value) => DynamicInfo.fromJson(value)).toList();
    return Dynamic(rows: protocolList);
  }
}

class DynamicInfo {
  String? elderName;
  String? sexName;
  int? age;
  String? nurseLevelName;
  String? branchName;
  String? buildingNo;
  String? floorNo;
  String? roomNo;
  String? content;
  List<PictureInfo>? attachList;

  DynamicInfo(
      {this.elderName,
      this.sexName,
      this.age,
      this.nurseLevelName,
      this.branchName,
      this.buildingNo,
      this.floorNo,
      this.roomNo,
      this.content,
      this.attachList});

  factory DynamicInfo.fromJson(Map<String, dynamic> json) {
    final originList = json['attachList'] as List?;
    print(originList);
    List<PictureInfo>? protocolList;
    if (originList != null) protocolList = originList.map((value) => PictureInfo.fromJson(value)).toList(); 
    print('protocolList');
    return DynamicInfo(
      attachList: protocolList ?? [],
      elderName: json['elderName'],
      sexName: json['sexName'],
      age: json['age'],
      nurseLevelName: json['nurseLevelName'],
      branchName: json['branchName'],
      buildingNo: json['buildingNo'],
      floorNo: json['floorNo'],
      roomNo: json['roomNo'],
      content: json['content'],
    );
  }
}

class PictureInfo {
  String? path;
  dynamic id;

  PictureInfo({
    this.path,
    this.id,
  });

  PictureInfo.fromJson(Map data) {
    path = data['path'];
    id = data['id'];
  }

  Map<String, dynamic> toJson() {
    return {
      'path': this.path,
      'id': this.id,
    };
  }


}
